package com.pioneer.gui.invoice.controller;

//import com.pioneer.gui.invoice.model.DropDownValue;

import java.awt.Component;

import javax.swing.ListCellRenderer;
import javax.swing.JList;
import javax.swing.JLabel;

public class DropDownRenderer
implements ListCellRenderer
{
	
	private JLabel renderer;
	
	public DropDownRenderer ()
	{
		renderer = new JLabel();
		//renderer.setOpaque (true);
	}
                           
	public Component getListCellRendererComponent(JList list, Object value, 
	int index, boolean isSelected, boolean cellHasFocus)
	{
		if (value == null)
		{
			renderer.setText("");			
		}
		else
		{
			Object[] d=(Object[]) value;
			//DropDownValue d = (DropDownValue) value;
			
			renderer.setText( d[1].toString() );
		}
		return renderer;
	}
}